#ifndef frm_control_TLine_H
#define frm_control_TLine_H

#include "frm_control_TPanel.h"

namespace frm { namespace control {

////////////////////////////////////////////////////////////////////////////////

struct TLine : public TPanel
{
  struct TStyle : public frm::TStyle
  {
    svl_Type(frm::TStyle)
    TPanel::TStyle Normal,Selected,Focused;
    //
    virtual void SetFromParent(frm::TStyle *Parent);
    virtual svl::TInfoParam AddInfoTo(svl::TInfoParam Info);
  };
  ///////////////
  struct TOptions
  {
    //bool EnProcKeyReturn;
    //
    //TOptions() { EnProcKeyReturn = false; }
  }
  Options;
  //                         
  TLine(TWindow &Window);
 ~TLine(); 
  svl_Type(TPanel)
  //
  TLine  &SetStyle(TStyle &V);
  TStyle &GetStyle() { return *style;}
  //
  bool SplitInComponentPos(TMergeSplit &MS,TLine &ToLine,TPanel *ComponentSplit,int ComponentSplitPos);
  //
  bool Split(TMergeSplit &MS,TLine &To,int Width);
  void Merge(TMergeSplit &MS,TLine &From);

protected:
  virtual void TComponent_KeyboardKey(grf::TKeyboardKey &KeyboardKey);
  //
  virtual bool TComponent_SelectEnable() { return true;}
  virtual void TComponent_SelectEnter ();
  virtual void TComponent_SelectExit  ();
  //
  virtual bool TComponent_FocusEnable() { return true;}
  virtual void TComponent_FocusEnter();
  virtual void TComponent_FocusExit ();
  //
  virtual void TComponent_MouseEnter();
  virtual void TComponent_MouseExit ();
  //
  virtual void TComponent_Mouse(TMouse Mouse);
  //
  virtual void TComponent_SetCaretByX  (TGeometryRect &GRect,int XClient);
  virtual void TComponent_SetCaretByPos(TGeometryRect &GRect,int Pos);
  //
  virtual void TComponent_ScrollToVisible(TGeometryRect &GRect);
  virtual void TComponent_InheritStyleFrom(TTableOfStyles &ParentStyles);

private:
  TStyle *style;
};

///////////////////////////////////////////////////////////////////////////////
}}

#endif
